package nl.vddijssel.social.login.client;

import nl.vddijssel.social.client.ClientFactory;
import nl.vddijssel.social.login.client.activity.LoginActivityMapper;

import com.google.gwt.activity.shared.ActivityManager;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.SimplePanel;

public class Login {
	private SimplePanel appWidget = new SimplePanel();
	
	public Login(RootPanel container,ClientFactory clientFactory){
		LoginFactory loginFactory = GWT.create(LoginFactory.class);
		EventBus eventBus = clientFactory.getEventBus();
		
		  // Start ActivityManager for the main widget with our ActivityMapper
        ActivityMapper activityMapper = new LoginActivityMapper(clientFactory,loginFactory);
        ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);
        activityManager.setDisplay(appWidget);
        container.add(appWidget);
	}

}
